﻿using System.Collections.Generic;
using System.Text;

namespace Rachmans.Sabang.Tools
{
    public class ArabicCharacterHelper
    {
        private static void getArabicNumber(StringBuilder sbArabicNumber, int number, Dictionary<int, Number> numbers)
        {
            if (number != 0)
            {
                int modResult = number % 10;
                number = number / 10;
                getArabicNumber(sbArabicNumber, number, numbers);
                sbArabicNumber.Append(numbers[modResult].Value);
            }
        }

        public static string GetArabicNumber(int number, Dictionary<int, Number> numbers)
        {
            StringBuilder sbArabicNumber = new StringBuilder();
            getArabicNumber(sbArabicNumber, number, numbers);
            return sbArabicNumber.ToString();
        }
    }
}
